using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Web;
using MeetingRoom.Data;
using MeetingRoom.Data.Implementation;
using MeetingRoom.Domain;
using MeetingRoom.Service;

namespace MeetingRoom.Service.Implementation
{
    /// <summary>
    /// Summary description for SimpleScheduleService
    /// </summary>
    public class SimpleScheduleService //: IScheduleService
    {
        protected IScheduleQuery scheduleQuery = null;

        protected IScheduleDao scheduleDao = null;

        public IScheduleDao ScheduleDao
        {
            set { this.scheduleDao = value; }
        }

        public IScheduleQuery ScheduleQuery
        {
            set
            {
                this.scheduleQuery = value;
            }
        }

        public SimpleScheduleService()
        {

        }

        protected static bool IsApplicable(Schedule schedule)
        {
           
            return false;
        }

        public bool Postpone(Schedule schedule, int minutes)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public bool Delay(Schedule schedule, int minutes)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public bool Cancel(Schedule schedule)
        {
            if (schedule.Status == ScheduleStatus.PENDING)
            {
                // notify the attendees in the future version
                this.scheduleDao.Delete(schedule);
                return true;
            }

            return false;
        }
    }
}